﻿<Window x:Class="PokemonDataEditor.View.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:vm="clr-namespace:PokemonDataEditor.ViewModel"
        xmlns:scm="clr-namespace:System.ComponentModel;assembly=WindowsBase"
        Title="MainWindow" Height="600" Width="800" WindowStartupLocation="CenterScreen">
    <DockPanel>
        <Menu DockPanel.Dock="Top" ItemsSource="{Binding Path=Menus}" ItemContainerStyle="{StaticResource CommandMenu}"/>
        <DockPanel>
            <TabControl DockPanel.Dock="Left" TabStripPlacement="Left" Width="200">
                <TabControl.Resources>
                    <Style TargetType="ListBoxItem">
                        <Setter Property="vm:WorkspaceViewModel.DbClickToOpen" Value="True"/>
                    </Style>
                    <Style TargetType="ListBox">
                        <Setter Property="DisplayMemberPath" Value="Name"/>
                    </Style>
                    <CollectionViewSource Source="{Binding Path=Moves}" x:Key="MoveSource">
                        <CollectionViewSource.SortDescriptions>
                            <scm:SortDescription PropertyName="Identity" Direction="Ascending"/>
                        </CollectionViewSource.SortDescriptions>
                    </CollectionViewSource>
                    <CollectionViewSource Source="{Binding Path=Pokemons}" x:Key="PokemonSource">
                        <CollectionViewSource.SortDescriptions>
                            <scm:SortDescription PropertyName="Number" Direction="Ascending"/>
                        </CollectionViewSource.SortDescriptions>
                    </CollectionViewSource>
                </TabControl.Resources>
                <TabItem Header="Types">
                    <ListBox ItemsSource="{Binding Path=PokemonTypes}" />
                </TabItem>
                <TabItem Header="Moves">
                    <Grid>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition/>
                        </Grid.RowDefinitions>
                        <TextBox KeyDown="SearchMove_KeyDown"/>
                        <ListBox Grid.Row="1" Name="MoveList" ItemsSource="{Binding Source={StaticResource MoveSource}}" 
                                 SelectedValuePath="Name"/>
                    </Grid>
                </TabItem>
                <TabItem Header="Pokemons">
                    <Grid>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition/>
                        </Grid.RowDefinitions>
                        <TextBox KeyDown="SearchPokemon_KeyDown"/>
                        <ListBox Name="PokemonList" ItemsSource="{Binding Source={StaticResource PokemonSource}}" 
                             SelectedValuePath="Number" Grid.Row="1"/>
                    </Grid>
                </TabItem>
            </TabControl>
            <TabControl ItemsSource="{x:Static vm:WorkspaceViewModel.OpenItems}" 
                        ItemContainerStyle="{StaticResource DataItem}" />
        </DockPanel>
    </DockPanel>
</Window>
